package com.fayou.cloud.cloudnacosconsumerorder8899.myhandler;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.fayou.cloud.entites.CommonResult;

/**
 * @auther zzyy
 * @create 2020-02-25 15:32
 */
public class CustomerBlockHandler {
    public static CommonResult handlerException(BlockException exception) {
        return new CommonResult(4444, "按客戶自定义,global handlerException----1");
    }

    public static CommonResult handlerException2(BlockException exception) {
        return new CommonResult(4444, "按客戶自定义,global handlerException----2");
    }

    public static String handlerException3(Throwable e) {
        return e.getMessage().toString();
    }

    public static String handlerException3(Integer id, Throwable e) {
        if (e == null || e.getMessage() == null) {
            return "错误消息为null";
        }
        return "按客戶自定义,global handlerException----2";
    }

    public static String handlerException4(Integer id, BlockException e) {
        if (e == null || e.getMessage() == null) {
            return "错误消息为null";
        }
        return "按客戶自定义,global handlerException----2";
    }
}
